package com.company;
import java.io.*;

/**
 * The class Palindrome searches a palindromes in a string entered in a console.
 * It contains the user interface and makes calculation a part of string.
 * @author Dusheyko Dima
 * @version 1.02 05.10.2013
 */
public class Palindrome {
    public static void main(String[] args) throws IOException {
        System.out.print("Please enter the string: ");
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String currentString = input.readLine();
        String massString[] = currentString.split(" ");

        for (String tmpString1 : massString) {
            if (tmpString1.length() > 2 && tmpString1.equalsIgnoreCase(new StringBuilder(tmpString1).reverse().toString())) {
                System.out.println(tmpString1);
            }
        }
    }

}

